<?php
/**
 * Clase de la tabla Dimensiones.
 */
class Variables_Model_DbTable_Dimensiones extends Zend_Db_Table_Abstract {
	/** Table name */
	protected $_name = 'dimensionesvariable';
	protected $_primary = 'coddimension';
	protected $_sequence = 'seq_dimensionesvariable';
//	protected $_rowClass = 'App_Audit_Row';
	
	public function getDimensionesVariable($datos=array()) {
		$select = $this->select()
		               ->from(array('d'=>'dimensionesvariable'),array("*"))
		               ->join(array('u'=>'unidades'),'u.codunidad=d.codunidad',array("nombreunidad"))
		               ->order("d.coddimension");
		$select->setIntegrityCheck(false);
		
		if (isset($datos["codvariable"])){
		    $select->where("d.codvariable=?",$datos["codvariable"]);
		}

		if (isset($datos["coddimension"])){
		    $select->where("d.coddimension=?",$datos["coddimension"]);
		}

		
		return $select->query()->fetchAll();
	}

}
